<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8"/>
    <title>编辑覆盖物</title>
  </head>
  <body>
    <div id="mapDiv" style="width:800px;height:600px;"></div>
    <script src="https://api.map.baidu.com/api?v=3.0&ak=0WF4D7OmWBQ0CGIdVXS8rmpk&s=1" type="text/javascript"></script>
    <script src="raphael.js"></script> 
    <script src="Curve.js"></script> 
    <script src="https://api.map.baidu.com/library/GeoUtils/1.2/src/GeoUtils.js"></script>  
    <script src="Editor.js"></script> 
    <script>  

    // 解决坐标漂移的bug
    // 这段代码需要写在要运行的程序开始
    new BMap.Polyline([new BMap.Point(116.404, 39.905),new BMap.Point(116.414, 39.905)]).hide();

    var map = new BMap.Map('mapDiv');
    map.centerAndZoom(new BMap.Point(116.404, 39.915),15);
    map.enableScrollWheelZoom();

    var curve = new BMap.Curve([
      new BMap.CurveCommand('M',[
        new BMap.Point(116.404,39.915)
      ]),
      new BMap.CurveCommand('C',[
        new BMap.Point(116.404, 39.905),
        new BMap.Point(116.414, 39.905),
        new BMap.Point(116.414, 39.915)
      ]),
      new BMap.CurveCommand('C',[
        new BMap.Point(116.414, 39.925),
        new BMap.Point(116.424, 39.925),
        new BMap.Point(116.424, 39.915)
      ])
    ]);

    var circle = new BMap.Circle(new BMap.Point(116.424, 39.915),1000);
    
    map.addOverlay(curve); 
    map.addOverlay(circle); 

    var editor = new BMap.Editor();
    editor.edit(curve);
    editor.edit(circle);
    editor.open();

    </script>
  </body>
</html>